package web_k;

import pojo_k.Bank;
import service_k.BankService;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet("/bankTotalServlet")
public class BankTotalServlet extends HttpServlet {
    private BankService service = new BankService();

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //1.完成查询

        Float total = service.selectTotal();

        //2.存入相应的request域中

        request.setAttribute("total",total);

        //3.转发
        request.getRequestDispatcher("/BankTotal.jsp").forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}
